package cn.line5.seam.exception;

/**
 * <h1>数据库异常处理类</h1>
 * 
 * @author Liu,Xiaojun
 * @since JDK1.6
 */
public class DBException extends SeamException {
	private static final long serialVersionUID = -1419089683904570898L;

	private String queryString;

	public DBException(Throwable root) {
		super(root);
	}

	public DBException(String s, Throwable root) {
		super(s, root);
	}

	public DBException(String s) {
		super(s);
	}

	public DBException(String s, String queryString) {
		super(s);
		this.queryString = queryString;
	}

	public DBException(String s, String queryString, Throwable root) {
		super(s, root);
		this.queryString = queryString;
	}

	public String getMessage() {
		String msg = super.getMessage();
		if (queryString != null)
			msg += " [" + queryString + ']';
		return msg;
	}
}
